BugĀ 581150 - GtkIconView tries to paint items with invalid sizes
authorMatthew Barnes <mbarnes@redhat.com>
Fri, 23 Oct 2009 23:32:25 +0000 (19:32 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Fri, 23 Oct 2009 23:32:25 +0000 (19:32 -0400)
Run gtk_icon_view_layout() if necessary before attempting to paint the
icon view items during an expose event.  This ensures all the items have
valid sizes, as some themes don't take kindly to negative dimensions.

gtk/gtkiconview.c

index 7bfbaa5573978b7c7ccb38c245f1ba94e055a73f..bb6ba2910086b31b0cd560206aaf1942cf0ae458 100644 (file)
@@ -1545,6 +1545,11 @@ gtk_icon_view_expose (GtkWidget *widget,
   if (expose->window != icon_view->priv->bin_window)
     return FALSE;
 
+  /* If a layout has been scheduled, do it now so that all
+   * cell view items have valid sizes before we proceed. */
+  if (icon_view->priv->layout_idle_id != 0)
+    gtk_icon_view_layout (icon_view);
+
   cr = gdk_cairo_create (icon_view->priv->bin_window);
   cairo_set_line_width (cr, 1.);